{% extends "templates/web.html" %}

{% block page_content %}
<div class="frappe-card">
    <div class="page-title">
        <h1>固定费用二维表配置</h1>
    </div>
    <div class="form-section">
        {{ frappe.include_form('Fixed Expense Table', doc.name, frm=frm) }}
    </div>
</div>

<!-- 二维表格展示 -->
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
            <tr>
                <<th>费用项目</</th>
                {% for month in 1..12 %}
                <<th>{{ month }}月</</th>
                {% endfor %}
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>{{ doc.expense_item }}</td>
                {% for row in doc.monthly_amounts %}
                <td>
                    {{ row.amount }}
                    <span class="badge {{ 'badge-success' if row.post_status == 'Posted' else 'badge-warning' }}">
                        {{ row.post_status }}
                    </span>
                </td>
                {% endfor %}
            </tr>
        </tbody>
    </table>
</div>
{% endblock %}
